package com.adulcimer;

import com.adulcimer.core.config.AppConfig;
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.servers.Server;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * @author Simon
 * @create 2025/2/6
 * @Description
 **/

@SpringBootApplication
@MapperScan(basePackages = {"com.adulcimer.models.entity.mapper","com.adulcimer.mappers"})
@EnableAsync
@OpenAPIDefinition(servers = {@Server(url = "/", description = "Default Server URL")})
@Slf4j
@ComponentScan(basePackages = {"com.adulcimer"})
public class ADulcimerApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext =SpringApplication.run(ADulcimerApplication.class, args);
        AppConfig appConfig = applicationContext.getBean(AppConfig.class);
        log.info("项目地址：http://localhost:{}/doc.html", appConfig.getPort());
    }

}
